﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>GD库函数综合使用实例</title>
</head>
<body>
<?php
	$im = imagecreatetruecolor(100,100);
	$string = 'PHP';
	$bg = imagecolorallocate($im, 255, 0, 0);
	imagefill($im,0,0,$bg);
	$black = imagecolorallocate($im, 0, 0, 0);
	imagechar($im, 5, 0, 0, $string, $black);//imagecharup
	header('Content-type: image/png');
	ob_clean();  
	flush();
	imagepng($im);     
	imagedestroy($im);


?>
</body>
</html>